// 一个为jsx的子组件(玩玩插槽)

export default {
    name: "myComponent",
    data() {
      return {
      };
    },
    props: {
      visible: {
        type: Boolean,
        default: false,
      },
      listData: {
        type: Array,
        default: function() {
          return [];
        },
      },
    },
    render() {
      console.log(this.$slots);
      return (
        <div vShow={this.visible}>
          {/**自定义作用域插槽*/}
          <div class="item">
            {/** 如果有标题插槽，则使用标题插槽，否则使用默认标题 */}
            {/* {titleSlot ? titleSlot(data) : <span>{data.title}</span>} */}
            {/* {this.listData.map((item) => (
              <button class="item-btn">
                按钮
                {this.$scopedSlots.test({
                  row: item,
                })}
              </button>
            ))} */}
           {
               this.$scopedSlots.test({
                user: {name:'纸飞机'}
            })
           }
              {
                  this.$scopedSlots.mytest({
                      user: {name:'纸飞机'}
                  })
              }
          </div>
        </div>
      );
    },
  };
